/**
 * 
 */
package org.lora.biz.ou.service;

import java.util.List;
import java.util.Map;

import org.lora.biz.ou.entity.OrgLevel;
import org.lora.biz.ou.entity.Organization;
import org.lora.biz.ou.exception.LoraOrgUserException;
import org.lora.core.mybatis.OrderByBean;
import org.lora.core.mybatis.Page;

/**
 * <p>
 * 类名:IOrganizationService
 * </p>
 * 描述:组织结构服务接口<br>
 * 创建时间:2016年8月31日 上午10:11:08<br>
 * 
 * @author Bladnir@outlook.com<br>
 *         修改历史:<br>
 *         2016年8月31日 Bladnir 创建<br>
 */
public interface IOrganizationService {

	/**
	 * 获取机构列表
	 * 
	 * @param domainId
	 * @param id
	 * @param parentId
	 * @return
	 * @throws LoraOrgUserException
	 */
	public List<Organization> getOrgList(String domainId, String id, String parentId) throws LoraOrgUserException;

	/**
	 * 获取机构级别列表
	 * 
	 * @param domainId
	 * @param parameterMap
	 * @param page
	 * @param orderByList
	 * @return
	 * @throws LoraOrgUserException
	 */
	public List<OrgLevel> getOrgLevelList(String domainId, Map<String, Object> parameterMap, Page page, List<OrderByBean> orderByList)
			throws LoraOrgUserException;

	/**
	 * 获取机构级别数量
	 * 
	 * @param domainId
	 * @param parameterMap
	 * @return
	 * @throws LoraOrgUserException
	 */
	public int getOrgLevelCount(String domainId, Map<String, Object> parameterMap) throws LoraOrgUserException;
	
	/**
	 * 保存机构实体
	 * 
	 * @param organization
	 * @return
	 * @throws LoraOrgUserException
	 */
	public int saveOrganization(Organization organization)throws LoraOrgUserException;
	
	/**
	 * 获取指定机构的所有父级机构<br>
	 * 包括自身<br>
	 * list的最后一个值是根节点<br>
	 * 
	 * @param domainId
	 * @param orgId
	 * @return
	 * @throws LoraOrgUserException
	 */
	public List<Organization> getAllParentOrganization(String domainId,String orgId)throws LoraOrgUserException;
	
	/**
	 * 获取指定机构的所有子机构<br>
	 * 包括自身<br>
	 * 
	 * @param domainId
	 * @param orgId
	 * @return
	 * @throws LoraOrgUserException
	 */
	public List<Organization> getAllChildrenOrganization(String domainId,String orgId)throws LoraOrgUserException;

}
